import { RouteRecordRaw } from 'vue-router'
import { DashboardFilled, DesktopOutlined } from '@vicons/antd'
import { renderIcon } from '@/util'
import { WorkspacePremiumRound } from '@vicons/material'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/dashboard',
        name: 'dashboard',
        redirect: '/dashboard/console',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '控制台',
            icon: renderIcon(DashboardFilled),
            role: 'auth',
            sort: 0,
        },
        children: [
            {
                path: 'console',
                name: 'dashboard.console',
                meta: {
                    title: '工作台',
                    icon: renderIcon(DesktopOutlined),
                    role: 'auth',
                    sort: 0,
                },
                component: () => import('@/views/dashboard/console/Index.vue'),
            },
            {
                path: 'workplace',
                name: 'dashboard.workplace',
                meta: {
                    title: '测试工具',
                    icon: renderIcon(WorkspacePremiumRound),
                    role: 'auth',
                    sort: 0,
                },
                component: () => import('@/views/dashboard/workplace/Index.vue'),
            },
            // {
            //     path: 'montior',
            //     name: 'dashboard.montior',
            //     meta: {
            //         title: '监控台',
            //         icon: renderIcon(MonitorRound),
            //         role: 'auth',
            //         sort: 0,
            //     },
            //     component: () => import('@/views/dashboard/montior/Index.vue'),
            // },
        ],
    },
]

export default routes
